/*jslint browser: true, devel: true, bitwise: true, white: true, plusplus: true, forin:true, nomen:true */
/*global $:true, define:true */

/**
 * @module Test
 */

define(function() {
"use strict";

/** 
 * 
 * @class MockObject
 * @constructor
 */
function MockObject() {
	this.Methods = {};
	this.Name = undefined;
	this.Args = undefined;
}

MockObject.prototype = {
	constructor: MockObject,
	when: function(methodName) {
		this.Name = methodName;
		return this;
	},
	
	get: function() {
		this.Args = arguments;
		return this;
	},
	
	thenReturn: function(ret) {
		this.addMockMethod(this.Name,this.Args||[],ret);
		return this;
	},
	
	addMockMethod: function(name, args, ret) {
		if (!this.Methods[name]) {
			this.Methods[name] = {};
			this[name] = function() {
				return this.Methods[name][arguments.toSource()];
			};
		} 
		this.Methods[name][args.toSource()] = ret;
	}
};

return MockObject;


});
